package com.nzx.cloud.eurekaclienthystrix.controller;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类描述：
 *
 * @auther niezhuxe
 * @date 2019/12/16
 */
@RestController
public class HystrixController {

    @RequestMapping("/message")
    @HystrixCommand(fallbackMethod = "hystrixFallback")
    public String hystrix(){

//        throw new RuntimeException();

        return "123456789";
    }

    public String hystrixFallback(){

        return "WebService is wrong!";
    }
}
